from django.db import models
from django.contrib.auth.models import AbstractUser

# Create your models here.
class User(AbstractUser):
    nickname = models.CharField(max_length=100, blank=True, null=True, verbose_name='昵称')
    openid = models.CharField(max_length=100, blank=True, null=True, verbose_name='openid')
    phone = models.BigIntegerField(unique=True,blank=True, null=True, verbose_name='联系方式')
    coins = models.IntegerField(blank=True, null=True, verbose_name='金币')
    avatar = models.FileField(upload_to='avatar')
    is_active = models.BooleanField(default=True, verbose_name='是否冻结')


    class Meta:
        verbose_name = '用户'
        verbose_name_plural = verbose_name
        ordering = ['id']

    def __str__(self):
        return self.username



